package cn.service.service.impl;

import cn.service.dao.UserDao;
import cn.service.entiy.User;
import cn.service.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public int regUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public Boolean login(User user) {
        int i=userDao.login(user);
        if(i>=1){
            return true;
        }
        return false;
    }

    @Override
    public User getUserById(Integer userId) {
        return userDao.getUserById(userId);
    }
}
